<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
    <head>
        <!-- Summernote CSS  -->
        <link rel="stylesheet" type="text/css" href="${rootPath}/js/plugins/summernote/summernote.css">
        <link rel="stylesheet" type="text/css" href="${rootPath}/js/plugins/summernote/summernote-bs3.css">
        <%@include file="../common/head.jspf" %>
    </head>

    <body class="sb-l-o sb-r-c" data-menu="#menu_loan" data-list="#li_loan_list">

        <!-- 主体内容开始 -->
        <div id="main">

            <!--侧边导航栏-->
            <%@include file="../common/sidebar.jspf" %>

            <!-- Start: Content-Wrapper -->
            <section id="content_wrapper">

                <!-- 顶部导航 -->
                <header id="topbar">
                    <div class="topbar-left">
                        <ol class="breadcrumb">
                            <li class="crumb-active">
                                <span>软擎科技</span>
                            </li>
                            <li class="crumb-icon">
                                <a href="dashboard"><span class="glyphicon glyphicon-home"></span></a>
                            </li>
                            <li class="crumb-icon">
                                <a href="loan/list/proposed">标的列表</a>
                            </li>
                            <!-- 当前页 -->
                            <c:choose>
                                <c:when test="${model != null}">
                                    <li class="crumb-trail">标的编辑</li>
                                    </c:when>
                                    <c:otherwise>
                                    <li class="crumb-trail">添加标的</li>
                                    </c:otherwise>
                                </c:choose>
                        </ol>
                    </div>
                    <div class="topbar-right">
                        <!-- 登录信息 -->
                        <%@include file="../common/session.jspf" %>
                    </div>
                </header>
                <!-- 顶部导航结束 -->

                <!-- 页面内容开始 -->
                <section id="content">
                    <div class="mw500 mauto mb20">
                        <c:choose>
                            <c:when test="${model != null}">
                                <h1 class="text-center text-muted-lighter mb10">
                                    <i class="fa fa-pencil-square-o mr5"></i>标的编辑 
                                    <a href="loan/list/proposed" class="fs12 mb30 ml10"><< 返回</a>
                                </h1>
                            </c:when>
                            <c:otherwise>
                                <h1 class="text-center text-muted-lighter mb10">
                                    <i class="fa fa-plus-square mr5"></i>添加标的 
                                    <a href="loan/list/proposed" class="fs12 mb30 ml10"><< 返回</a>
                                </h1>
                            </c:otherwise>
                        </c:choose>
                    </div>
                    <div class="row">
                        <!--<div class="col-md-6">-->
                        <div class="mw500 mauto">
                            <div class="admin-form"><div class="section-divider mb20"><span> 基本信息  </span></div></div>
                            <form class="form-horizontal" role="form" id="loanForm" novalidate>
                                <div class="alert alert-sm alert-danger pastel light alert-dismissable pv10 shide">
                                    <i class="fa fa-exclamation-circle pr10"></i>
                                    <strong id="error_message"></strong>
                                </div>

                                <input type="hidden" name="id" value="${model}" />
                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">标的名称</span>
                                        <input class="form-control" 
                                               type="text" 
                                               name="title"
                                               id="title"
                                               required
                                               placeholder="用于前端显示的标的名称">
                                    </div>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">借款用户</span>
                                        <input class="form-control" 
                                               type="text" 
                                               name="loginName"
                                               id="loginName"
                                               required
                                               placeholder="借款人用户名或手机号">
                                    </div>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">还款方式</span>
                                        <select name="repayMethod" id="repayMethod" class="multiselect">
                                            <c:forEach items="${RepayMethod}" var="method">
                                                <option value="${method}">${method.key}</option>
                                            </c:forEach>
                                        </select>
                                        <span class="input-group-addon">标的类型</span>
                                        <select name="loanProduct" id="loanProduct" class="multiselect">
                                            <c:forEach items="${LoanProductKey}" var="product">
                                                <option value="${product}">${product.key}</option>
                                            </c:forEach>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">是否定向</span>
                                        <select name="loanDirect" id="loanDirect" class="multiselect">
                                            <c:forEach items="${LoanDirect}" var="direct">
                                                <option value="${direct}">${direct.key}</option>
                                            </c:forEach>
                                        </select>
                                     </div>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">标的金额</span>
                                        <input class="form-control" 
                                               type="text" 
                                               name="amount"
                                               id="amount"
                                               required
                                               placeholder="标的筹款金额">
                                        <span class="append-icon right"><i class="fa fa-check"></i></span>
                                    </div>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group w175 pull-left">
                                        <span class="input-group-addon">年化利率</span>
                                        <input class="form-control text-center" 
                                               type="text" 
                                               name="rate"
                                               id="rate"
                                               required
                                               value="10.0">
                                        <span class="input-group-addon text-primary">%</span>
                                    </div>
                                    <code class="pull-left ml10 mt8">实际年化利率 + 附加利率</code>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group w175 pull-left">
                                        <span class="input-group-addon">附加利率</span>
                                        <input class="form-control text-center" 
                                               type="text" 
                                               name="additionalRate"
                                               id="additionalRate"
                                               required
                                               value="0">
                                        <span class="input-group-addon text-primary">%</span>
                                    </div>
                                    <code class="pull-left ml10 mt8">平台额外奖励的利率</code>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group w175 pull-left">
                                        <span class="input-group-addon">借款周期</span>
                                        <input class="form-control text-center" 
                                               type="text" 
                                               name="years"
                                               id="years"
                                               required
                                               value="0">
                                        <span class="input-group-addon text-primary br-r-n">年</span>
                                    </div>
                                    <div class="input-group w110 pull-left">
                                        <input class="form-control text-center" 
                                               type="text" 
                                               name="months"
                                               id="months"
                                               required
                                               value="1">
                                        <span class="input-group-addon text-primary br-r-n">个月</span>
                                    </div>
                                    <div class="input-group w100 pull-left">
                                        <input class="form-control text-center" 
                                               type="text" 
                                               name="days"
                                               id="days"
                                               required
                                               value="0">
                                        <span class="input-group-addon text-primary">天</span>
                                    </div>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group w185">
                                        <span class="input-group-addon">筹款时长</span>
                                        <input class="form-control text-center" 
                                               type="text" 
                                               name="timeOut"
                                               id="timeOut"
                                               required
                                               value="72">
                                        <span class="input-group-addon text-primary">小时</span>
                                    </div>
                                </div>

                                <div class="admin-form"><div class="section-divider mt40 mb20"><span> 投标规则  </span></div></div>

                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">最小投标金额</span>
                                        <input class="form-control" 
                                               type="text" 
                                               name="minAmount"
                                               id="minAmount"
                                               required
                                               value="1">
                                        <span class="append-icon right"><i class="fa fa-check"></i></span>
                                    </div>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">最大投标金额</span>
                                        <input class="form-control" 
                                               type="text" 
                                               name="maxAmount"
                                               id="maxAmount"
                                               required
                                               value="1000000">
                                        <span class="append-icon right"><i class="fa fa-check"></i></span>
                                    </div>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">投标金额增量</span>
                                        <input class="form-control" 
                                               type="text" 
                                               name="stepAmount"
                                               id="stepAmount"
                                               required
                                               value="1">
                                        <span class="append-icon right"><i class="fa fa-check"></i></span>
                                    </div>
                                </div>
                                <div class="admin-form"><div class="section-divider mt40 mb20"><span> 合同设置  </span></div></div>

                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">合同</span>
                                        <select name="contractId" id="contractId" class="multiselect">
                                            <c:forEach items="${ContractTemplate}" var="contract">
                                                <option value="${contract.id}">${contract.name}</option>
                                            </c:forEach>
                                        </select>
                                    </div>
                                </div>
                                
                                <div class="admin-form"><div class="section-divider mt40 mb20"><span> 费率设置  </span></div></div>

                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">借款服务费</span>
                                        <input class="form-control" 
                                               type="text" 
                                               name="serviceFee"
                                               id="serviceFee"
                                               required
                                               placeholder="">
                                        <span class="input-group-addon text-primary">%</span>
                                    </div>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">借款担保费</span>
                                        <input class="form-control" 
                                               type="text" 
                                               name="guaranteeFee"
                                               id="guaranteeFee"
                                               required
                                               placeholder="">
                                        <span class="input-group-addon text-primary">%</span>
                                    </div>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">借款管理费</span>
                                        <input class="form-control" 
                                               type="text" 
                                               name="manageFee"
                                               id="manageFee"
                                               required
                                               placeholder="">
                                        <span class="input-group-addon text-primary">%</span>
                                    </div>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">投资管理费</span>
                                        <input class="form-control" 
                                               type="text" 
                                               name="investFee"
                                               id="investFee"
                                               required
                                               placeholder="">
                                        <span class="input-group-addon text-primary">%</span>
                                    </div>
                                </div>
                                <div class="admin-form"><div class="section-divider mt40 mb20"><span> 其他设置  </span></div></div>

                                <div class="form-group mhn">
                                    <div class="input-group">
                                        <span class="input-group-addon">活动链接</span>
                                        <input class="form-control" 
                                               type="text" 
                                               name="activityLink"
                                               id="activityLink"
                                               required
                                               placeholder="">
                                    </div>
                                </div>
                                <div class="form-group mhn">
                                    <div class="input-group w175 pull-left">
                                        <span class="input-group-addon">奖励利率</span>
                                        <input class="form-control text-center" 
                                               type="text" 
                                               name="rewardRate"
                                               id="rewardRate"
                                               required>
                                        <span class="input-group-addon text-primary">%</span>
                                    </div>
                                </div>
                                <div class="form-group mhn">
                                    <button type="button" class="btn btn-primary btn-block" id="saveLoanBtn">保存标的</button>
                                </div>
                            </form>
                        </div>
                        <!--</div>-->

                        <%--
                        <div class="col-md-6">
                            <div class="mw600 mauto">
                                <div class="admin-form"><div class="section-divider mb20"><span> 标的描述  </span></div></div>
                                <div class="bg-white mb40">
                                    <div class="summernote form-control" id="description"></div>
                                </div>

                                <div class="admin-form"><div class="section-divider mt20 mb20"><span> 担保说明  </span></div></div>
                                <div class="bg-white mb40">
                                    <div class="summernote form-control" id="guaranteeInfo"></div>
                                </div>

                                <div class="admin-form"><div class="section-divider mt20 mb20"><span> 抵押说明  </span></div></div>
                                <div class="bg-white mb40">
                                    <div class="summernote form-control" id="mortgageInfo"></div>
                                </div>

                            </div>
                        </div>
                        --%>
                    </div>
                </section>
                <!-- 页面内容结束 -->

            </section>
        </div>
        <!-- 主体内容结束 -->

        <!-- 公共函数 -->
        <%@include file="../common/scripts.jspf" %>
        <script type="text/javascript" src="${rootPath}/js/admin-tools/admin-forms/js/jquery.validate.min.js"></script>
        <script type="text/javascript" src="${rootPath}/js/admin-tools/admin-forms/js/additional-methods.min.js"></script>
        <!-- Summernote JS -->
        <script type="text/javascript" src="${rootPath}/js/plugins/summernote/summernote.min.js"></script>
        <script type="text/javascript" src="${rootPath}/js/plugins/summernote/lang.js"></script>
        <script type="text/javascript" src="${rootPath}/js/pages/loan/edit.js"></script>
    </body>
</html>